package cn.zero.letaomallspringboot.exception;

import static cn.zero.letaomallspringboot.Constant.ResultCode.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

@EqualsAndHashCode(callSuper = true)
@Data
public class CustomException extends RuntimeException {
    private Integer code;
    private String msg;

    public CustomException(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public CustomException(String msg) {
        this.code = CUSTOM_ERROR.getCode();
        this.msg = msg;
    }
}
